import { createRouter, createWebHashHistory, createWebHistory } from "vue-router";

const routes = [
    {
        path: '/',
        redirect: 'home',  //重定向
    },
    // 主页
    {
        path: '/home',
        component: () => import("../views/home/home.vue"),
    },
    // 联系人
    {
        path: '/contacts',
        component: () => import("../views/contacts/contacts.vue"),
    },
    // 聊天
    {
        path: '/message',
        component: () => import("../views/message/message.vue"),
    },
    // 询盘
    {
        path: '/rfq',
        component: () => import("../views/rfq/rfq.vue"),
    },
    // 报价
    {
        path: '/qtn',
        component: () => import("../views/qtn/qtn.vue")
    },
    // 订单
    {
        path: '/order',
        component: () => import("../views/order/order.vue"),
    },
    // 财务
    {
        path: '/payment',
        component: () => import("../views/payment/payment.vue"),
    },
    // 运输
    {
        path: '/shipment',
        component: () => import("../views/shipment/shipment.vue"),
    },
    // 产品
    {
        path: '/product',
        component: () => import("../views/product/product.vue"),
        children: [
            {
                path: 'redact',
                component: () => import("../views/product/children/redact.vue"),
            }
        ]
    },
    //产品编辑
    {
        path: '/redact',
        component: () => import('../views/product/children/redact.vue')
    },
    // 站群
    {
        path: '/website',
        component: () => import("../views/website/index.vue"),
        redirect: '/website/themes',
        children: [
            {
                path: 'themes',
                component: () => import("../views/website/themes/index.vue"),
            }, {
                path: 'dome-themes',
                component: () => import("../views/website/dome-themes/index.vue"),
            }, {
                path: 'settings',
                component: () => import("../views/website/settings/index.vue"),
            }, {
                path: 'categories',
                component: () => import("../views/website/categories/index.vue"),
            }, {
                path: 'banners',
                component: () => import("../views/website/banners/index.vue"),
            }, {
                path: 'meuns',
                component: () => import("../views/website/meuns/index.vue"),
            }, {
                path: 'dome',
                component: () => import("../views/website/dome.vue"),
            }, {
                path: 'pages',
                component: () => import("../views/website/Pages/index.vue"),
            }
        ]
    },
    // 文件
    {
        path: '/files',
        component: () => import("../views/files/files.vue"),
    },
    // 提取文件
    {
        path:'/extract',
        component:()=>import("../views/files/extract.vue")
    },
    // 邮件
    {
        path: '/email',
        component: () => import("../views/email/email.vue"),
    },
    // 插件
    {
        path: '/addons',
        component: () => import("../views/addons/addons.vue"),
    },
    // demo
    // {
    //     path: '/demo',
    //     component: () => import("../views/demo/demo.vue"),
    // }
]


const router = createRouter({
    // history: createWebHistory(),
    history: createWebHashHistory(), // hash模式
    routes,
});

export default router;